<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/11/15
 * Time: 10:34
 */

namespace HiCommon\Model;


class Upkeep extends Base
{

    protected $table = 'upkeep';

    protected $guarded = [];

    //public $timestamps = false;

    /**
     * 应该被调整为日期的属性
     *
     * @var array
     */
    protected $dates = [
    ];

    //一对一关联分类
    public function car()
    {
        return $this->hasOne(UsersVehicle::class, 'id','car_id')->where('is_default',1)
            ->select('id','brand','vehicle_type');
    }

    public function car_info()
    {
        return $this->hasOne(UsersVehicle::class, 'id','car_id');
    }


}